/*
 * Copyright (C) 2004-2006  Autodesk, Inc.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of version 2.1 of the GNU Lesser
 * General Public License as published by the Free Software Foundation.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
#ifndef FdoWcsOvBoundingBoxDefinition_H
#define FdoWcsOvBoundingBoxDefinition_H

#ifdef _WIN32
#pragma once
#endif //_WIN32

#include <WCS/FdoWcsOvProvider.h>

/// \brief
///  
/// The FdoWcsOvBoundingBoxDefinition class defines a WCS BoundingBox that will be used to specify a map within it.
class FdoWcsOvBoundingBoxDefinition : public FdoPhysicalElementMapping
{
    typedef FdoPhysicalElementMapping BaseType;
    friend class FdoWcsOvCoverageDefinition;

public:
    /// \brief
    /// Constructs a new empty BoundingBox definition.
    /// 
    /// \return
    /// Returns the newly created FdoWcsOvBoundingBoxDefinition instance.
    /// 
    FDOWCS_API static FdoWcsOvBoundingBoxDefinition* Create();

    /// \brief
    /// Get the CRS property of the BoundingBox.
    /// 
    /// \return
    /// Returns the CRS property of the BoundingBox.
    /// 
    FDOWCS_API FdoString* GetCRS(void) const;

    /// \brief
    /// Set the CRS property of the BoundingBox.
    /// 
    /// \remarks
    /// 
    /// 
    /// \return
    /// Returns nothing.
    /// 
    FDOWCS_API void SetCRS(FdoString* crs);

    //FDOWCS_API FdoDoubleArray* GetLowerCorner(void) const;

    //FDOWCS_API void SetLowerCorner(FdoDoubleArray* lowerCorner);

    //FDOWCS_API FdoDoubleArray* GetUpperCorner(void) const;

    //FDOWCS_API void SetUpperCorner(FdoDoubleArray* upperCorner);

    FDOWCS_API FdoDouble GetMinX() const;
    FDOWCS_API void SetMinX(FdoDouble value);

    FDOWCS_API FdoDouble GetMinY() const;
    FDOWCS_API void SetMinY(FdoDouble value);

    FDOWCS_API FdoDouble GetMaxX() const;
    FDOWCS_API void SetMaxX(FdoDouble value);

    FDOWCS_API FdoDouble GetMaxY() const;
    FDOWCS_API void SetMaxY(FdoDouble value);


    /// \brief
    /// Gets the fully qualified name of this element
    /// 
    /// \return
    /// Returns the qualified element name
    /// 
    FDOWCS_API virtual FdoStringP GetQualifiedName();

/// \cond DOXYGEN-IGNORE

public:
    /// XML Serialization functions, not part of supported API.
    FDOWCS_API virtual void InitFromXml(FdoXmlSaxContext* context, FdoXmlAttributeCollection* attrs);
    FDOWCS_API virtual FdoXmlSaxHandler* XmlStartElement(
        FdoXmlSaxContext* context, 
        FdoString* uri, 
        FdoString* name, 
        FdoString* qname, 
        FdoXmlAttributeCollection* atts
    );
    FDOWCS_API virtual FdoBoolean XmlEndElement(FdoXmlSaxContext* context, FdoString* uri, FdoString* name, FdoString* qname);
    FDOWCS_API void _writeXml( FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags );

public:
    FDOWCS_API virtual ~FdoWcsOvBoundingBoxDefinition(void);

protected:
    FDOWCS_API FdoWcsOvBoundingBoxDefinition(void);
    void Dispose(void);
/// \endcond

private:
    FdoXmlCharDataHandler *m_pXmlContentHandler;
    FdoStringP m_crs;           // ex. urn:ogc:def:crs:EPSG::32661
    //FdoDoubleArray* m_lowerCorner;   // ex. -179.999998745864 34.9037152643753
    //FdoDoubleArray* m_upperCorner;   // ex. 178.959571606408 53.7717181062498

    FdoDouble m_minX;
    FdoDouble m_minY;
    FdoDouble m_maxX;
    FdoDouble m_maxY;
};

/// \brief
///  FdoWcsOvBoundingBoxDefinitionP is a FdoPtr on FdoWcsOvBoundingBoxDefinition, provided for convenience. 
typedef FdoPtr<FdoWcsOvBoundingBoxDefinition> FdoWcsOvBoundingBoxDefinitionP;

#endif
